#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define N 2e5+10;
#define INF 0x3f3f3f3f;
typedef long long int ll;
#define sd(n) scanf("%d",&n)
#define sld(n) scanf("%lld",&n)
#define pd(n) printf("%d", (n))
#define pld(n) printf("%lld", n)
char ch[100010];
//----------------------------------------------------------------------------//
int main()
{
    ll n;
    sld(n);
    if(n==1||n==145)
    {
    	printf("%d\n",n);
    	return 0;
    	
    }
    while (1)
    {
        if (n == 145 || n == 1) break;

        pld(n);
        int cnt = 0;
        ll cur = 0;

        while (n % 10 || n / 10 != 0)
        {
            cur += (n % 10) * (n % 10);
            ch[++cnt] = (n % 10) + '0';
            n /= 10;
        }
        printf("->");
        for (int j = cnt; j >= 1; j--)
        {
            printf("%c*%c", ch[j], ch[j]);
            if (j != 1)
            {
                printf("+");
            }
            if (j == 1)
            {
                printf("=%lld", cur);
            }
        }
        n = cur;
        puts("");

    }
    return 0;
}